package com.example.demo.repository.dao;

import com.example.demo.entity.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Repository
@Transactional
public interface UserDao extends JpaRepository<User, String>, JpaSpecificationExecutor<User> {
    User findUserByPhoneNumber(String number);

    int deleteByPhoneNumber(String number);

    int deleteByPhoneNumberIn(List<String> numbers);

    List<User> findByPhoneNumberIn(List<String> numbers);

}
